package com.erp.erp_servers.money.imp;

import com.erp.erp_dao.money.IPaymentRefundDao;
import com.erp.erp_entitys.money.entity.PaymentRefundEntity;
import com.erp.erp_servers.money.IPaymentRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : PaymentRefundServiceImp
 * @Description : 付款-退款接口实现类
 * @Author : lst
 * @Date: 2021-04-05 09:36
 */
@Service
public class PaymentRefundServiceImp implements IPaymentRefundService {

    /**
     * 注入mapper
     */
    private final IPaymentRefundDao paymentRefundDao;

    @Autowired
    public PaymentRefundServiceImp(IPaymentRefundDao paymentRefundDao) {
        this.paymentRefundDao = paymentRefundDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PaymentRefundEntity queryById(Integer id) {
        return paymentRefundDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param paymentRefund 实例对象
     * @return 对象列表
     */
    @Override
    public List<PaymentRefundEntity> queryAll(PaymentRefundEntity paymentRefund) {
        return paymentRefundDao.queryAll(paymentRefund);
    }

    /**
     * 新增数据
     *
     * @param paymentRefund 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(PaymentRefundEntity paymentRefund) {
        return paymentRefundDao.insert(paymentRefund);
    }

    /**
     * 修改数据
     *
     * @param paymentRefund 实例对象
     * @return 影响行数
     */
    @Override
    public int update(PaymentRefundEntity paymentRefund) {
        return paymentRefundDao.update(paymentRefund);
    }

    /**
     * 批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<PaymentRefundEntity> list) {
        return paymentRefundDao.addList(list);
    }
}
